package com.fight.strive.sys.modules.auth.dto;

import com.fight.strive.sys.modules.rbac.entity.RbacDepartmentEntity;
import com.fight.strive.sys.modules.rbac.entity.RbacUserEntity;
import com.fight.strive.sys.modules.validator.StriveNotBlank;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Map;

@Data
@Accessors(chain = true)
public class StriveAuthInfo {

    /**
     * token
     */
    private String token;

    /**
     * 用户名
     */
    @StriveNotBlank(msg = "登名不能为空")
    private String loginName;

    /**
     * 登录密码
     */
    private String password;

    /**
     * 用户信息
     */
    private RbacUserEntity user;

    /**
     * 用户所在的部门
     */
    private List<RbacDepartmentEntity> departments;

    /**
     * 角色代码集合
     * {"R1": true}
     */
    private Map<String, Boolean> roles;

    /**
     * 资源权限代码及操作权限
     * {"P1":{"OP2":true}, "P2":{"OP1":true}}
     */
    private Map<String, Map<String, Boolean>> resoures;

}
